package com.chris.libs.example.pages.tabs.main.widget;

import com.chris.libs.base.x.mvpp.mvpp.AbsStandardFragmentViewProxy;
import com.chris.libs.example.common.utils.FunItemUtil;
import com.chris.libs.example.pages.ext.basewidget.BaseWidgetActivity;
import com.chris.libs.example.pages.ext.smartrefresh.SmartRefreshActivity;
import com.chris.libs.example.pages.ext.swiperefresh.SwipeRefreshActivity;

import javax.inject.Inject;


/**
 * @author Chris chan
 * Create on： 2025/2/1 19:40
 * Use for: UI界面元素处理代理类
 * Explain:
 */
public class WidgetViewProxy extends AbsStandardFragmentViewProxy implements WidgetContract.UIView {
    private WidgetViewModel viewModel;
    @Inject
    WidgetViewHolder vh;
    @Inject
    WidgetPresenter presenter;

    @Inject
    public WidgetViewProxy() {
    }

    @Override
    protected void init() {
        this.viewModel = getViewModel(WidgetViewModel.class);
        this.vh.bind(this.contentView);
        this.presenter.bindView(this);
        this.presenter.setViewModel(this.viewModel);
    }

    @Override
    protected void initView() {
        FunItemUtil.addButton(this.context, this.vh.llContainer, "BaseWidget", BaseWidgetActivity.class);
        FunItemUtil.addButton(this.context, this.vh.llContainer, "SwipeRefresh", SwipeRefreshActivity.class);
        FunItemUtil.addButton(this.context, this.vh.llContainer, "SmartRefresh", SmartRefreshActivity.class);
    }

    @Override
    protected void setupEvent() {
        //update(this.viewModel.getText(), this.vh.tvInfo::setText);
    }

    @Override
    protected void onReady() {
        //this.presenter.requestAndUpdate();
    }

//    @OnClick({R.id.tv_info})
//    public void onClick(View view) {
//        showMessage("我的文本框被点击了");
//    }
}
